package cci.siteMarchand.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import cci.siteMarchand.dao.GenericDAO;
import cci.siteMarchand.model.DTOGenre;

public class GenreDao extends GenericDAO<DTOGenre> {

	@Override
	public DTOGenre create(DTOGenre obj) {
		
		return null;
	}

	@Override
	public DTOGenre update(DTOGenre obj) {
		delete(obj.getID());

		return create(obj);
	}

	@Override
	public String getTableName() {
		return "ADMIN.GENRE";
	}

	@Override
	public DTOGenre convertObjet(ResultSet result) throws SQLException {
		
		DTOGenre obj = new DTOGenre();
		obj.setID(result.getInt(1));
		obj.setLibelle(result.getString(2));
		obj.setPriorite(result.getInt(3));
		
		return obj;
	}

}
